# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=openjpeg
pkgver=1.5.2
pkgrel=1
pkgdesc="An open source JPEG 2000 codec"
arch=(i686 x86_64)
license=('BSD')
url="http://www.openjpeg.org"
depends=('zlib')
makedepends=('libtiff' 'lcms2' 'libpng' 'doxygen')
optdepends=('lcms2: j2k_to_image and image_to_j2k programs'
            'libpng: j2k_to_image and image_to_j2k programs')
source=(http://downloads.sourceforge.net/openjpeg.mirror/${pkgname}-${pkgver}.tar.gz)
sha1sums=('496e99ff1d37b73bbce6a066dd9bd3576ebca0a2')


build() {
  cd $pkgname-$pkgver
  autoreconf -fi
  # make sure we use system libs
  rm -rf thirdparty
  ./configure --prefix=/usr \
	--enable-shared --disable-static --disable-silent-rules
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/openjpeg"
  install -m644 LICENSE "${pkgdir}/usr/share/licenses/openjpeg/LICENSE"
}
